﻿using System.Diagnostics;

namespace OP30.GlobalVariables
{
    #region parameters
    public static class ST5ServoParam_Global
    {
        public static float nAcc { get; set; }         //加速度
        public static float nDec { get; set; }         //减速度
        public static float Override { get; set; }     //JOG速度百分比
        public static float nHomeSpeed { get; set; }   //原点速度
        public static float nHomePos { get; set; }     //原点位置
        public static float nJogSpeed { get; set; }    //JOG速度
        public static short nHomeMode { get; set; }    //回原点模式

        public static aWork[] aWork { get; set; } = new aWork[10] {
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },

        };
    }


    public static class ST13ServoParam_Global
    {
        public static float nAcc { get; set; }         //加速度
        public static float nDec { get; set; }         //减速度
        public static float Override { get; set; }     //JOG速度百分比
        public static float nHomeSpeed { get; set; }   //原点速度
        public static float nHomePos { get; set; }     //原点位置
        public static float nJogSpeed { get; set; }    //JOG速度
        public static short nHomeMode { get; set; } = 3;   //回原点模式

        public static aWork[] aWork { get; set; } = new aWork[10] {
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },
            new() { },

        };
    }
    public class aWork
    {
        public float aWorkPos { get; set; }
        public float aWorkSpeed { get; set; }
    }


    //感应器
    public static class InductorParam_Global
    {
        public static bool[] aByPass { get; set; } = new bool[16];
        public static int[] aDelay { get; set; } = new int[16];
    }
    public static class TechniqueParam_Global
    {

        public static float nPinWidthLimitDown { get; set; }   //ST3电极针间距下限
        public static float nPinWidthLimitUp { get; set; }     //ST3电极针间距上限
        public static float nWeldPressLimitDown { get; set; }      //St5焊接压力下限
        public static float nWeldPressLimitUp { get; set; }        //St5焊接压力上限
        public static float nWeldAreaLimitDown { get; set; }         //ST11焊缝面积下限
        public static float nWeldAreaLimitUp { get; set; }           //ST11焊缝面积上限


        public static float nParaData1 { get; set; }
        public static float nParaData2 { get; set; }
        public static float nParaData3 { get; set; }
        public static float nParaData4 { get; set; }
    }


    public static class UseCount_Global
    {
        public static int nParaData1 { get; set; }
        public static int nParaData2 { get; set; }
        public static int nParaData3 { get; set; }
        public static int nParaData4 { get; set; }
        public static int nParaData5 { get; set; }
        public static int nParaData6 { get; set; }

    }

    public static class ContinuousNGCount_GLobal
    {
        public static short nParaData0 { get; set; }
        public static short nParaData1 { get; set; }
        public static short nParaData2 { get; set; }
        public static short nParaData3 { get; set; }
        public static short nParaData4 { get; set; }
        public static short nParaData5 { get; set; }
        public static short nParaData6 { get; set; }
        public static short nParaData7 { get; set; }
        public static short nParaData8 { get; set; }
        public static short nParaData9 { get; set; }

    }



    #endregion

    #region 伺服




    public class ServoPCToPLC_Global
    {
        public bool bReleaseBT { get; set; }     //使能按钮
        public bool bHomeBT { get; set; }        //回原点按钮
        public bool bForwardBT { get; set; }     //正方向按钮
        public bool bReverseBT { get; set; }     //负方向按钮
        public bool bManualMoveBT { get; set; }  //手动定位按钮
        public bool bBackAutoPosBT { get; set; } //返回自动位置按钮
        public int nHmiIndex { get; set; }      //HMI轴位置编号


    }

    public class ServoPLCToPC_Global
    {
        public bool bPowerOK { get; set; }       //使能OK反馈
        public bool bHomeCmp { get; set; }       //回原点完成
        public bool bForwardMoving { get; set; } //正转移动
        public bool bReverseMoving { get; set; } //反转移动
        public bool bManualMoving { get; set; }  //手动定位中
        public bool bNotInAutoPos { get; set; }  //不在自动位
        public bool bAxisError { get; set; }     //轴警告
        public bool bAxisAlarm { get; set; }     //轴报警
        public bool bLimmitAlarm { get; set; }   //极限报警
        public bool bRelative { get; set; }      //0:绝对定位模式     1:相对定位模式
        public bool bMDI_Mode { get; set; }      //0 - 位置方式，1 - 速度方式
        public bool bHomeDirection { get; set; } //回原点方式0：正方向，1：负方向
        public bool bManualLock { get; set; }    //手动中可动作条件
        public bool bAutoLock { get; set; }      //自动可动作条件
        public bool bOriginSensor { get; set; }  //原点
        public bool bCcwLimitSensor { get; set; }//负极限
        public bool bCwLimitSensor { get; set; } //正极限
        public bool bAxisBusy { get; set; }      //轴运动中
        public bool bBreakOut { get; set; }      //刹车打开
        public float nActualPosition { get; set; }//当前位置
        public float nActualVelocity { get; set; }//当前速度
        public int nAutoIndex { get; set; }     //自动轴位置编号
        public int nCurrIndex { get; set; }     //当前轴位置编号

        public bool[] nAralmHMIdiaplay { get; set; } = new bool[16];
        public bool[] nFaultCode { get; set; } = new bool[16];
    }


    /// <summary>
    /// 桥丝卷
    /// </summary>
    public static class ST5Servo_Global
    {
        public static ServoPCToPLC_Global servoPCToPLC_Global { get; set; } = new ServoPCToPLC_Global();

        public static ServoPLCToPC_Global ServoPLCToPC_Global { get; set; } = new ServoPLCToPC_Global();
    }

    /// <summary>
    /// 桥丝转塔
    /// </summary>
    public static class ST13Servo_Global
    {
        public static ServoPCToPLC_Global servoPCToPLC_Global { get; set; } = new ServoPCToPLC_Global();

        public static ServoPLCToPC_Global ServoPLCToPC_Global { get; set; } = new ServoPLCToPC_Global();
    }



    #endregion

    #region 气缸

    public class CylinderPCToPLC_Global
    {
        public bool bManualBT { get; set; }      //手动操作按钮
        public bool bOrgSenByPass { get; set; }  //原点警报屏蔽
        public bool bWorkSenByPass { get; set; } //动点警报屏蔽
        public int tBackTime { get; set; }      //原点延迟
        public int tGoTime { get; set; }        //动点延迟


    }

    public class CylinderPLCToPC_Global
    {
        public bool bOriginSensor { get; set; }  //气缸原点感应器
        public bool bWorkSensor { get; set; }    //气缸动点感应器
        public int nCyStatus { get; set; }      //气缸状态显示
        public bool[] nHmiDisplay { get; set; } = new bool[16];  //故障显示
    }

    /// <summary>
    /// ST1分料夹爪气缸
    /// </summary>
    public static class ST01MaterialSpiltCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }



    /// <summary>
    /// ST1产品夹持气缸
    /// </summary>
    public static class ST01ProductClampCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }
    /// <summary>
    ///ST1夹持错位气缸
    /// </summary>
    public static class ST01ClampChuoWeiCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    /// <summary>
    /// ST1上料顶升气缸
    /// </summary>
    public static class ST01LoadJackCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }
    /// <summary>
    /// ST1上料错位气缸
    /// </summary>
    public static class ST01LoadChuoWeiCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    /// <summary>
    /// 
    /// </summary>
    public static class ST01CarryJiaZhua01Cy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }
    /// <summary>
    /// 
    /// </summary>

    public static class ST01CarryJiaZhua02Cy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();

    }
    /// <summary>
    /// 
    /// </summary>
    public static class ST01CarrySpinCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    /// <summary>
    /// 
    /// </summary>
    public static class ST01CarryUpDownCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    /// <summary>
    /// ST1载具打开
    /// </summary>
    public static class ST01CarrierOpenCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    /// <summary>
    /// ST3上下气缸
    /// </summary>
    public static class ST3UpDownCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    /// <summary>
    /// 
    /// </summary>
    public static class ST5UpDownCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    public static class ST5JackCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST5ShielddUpDownCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    public static class ST5CarrierOpenCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST9CoolBlowCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST11UpDownCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST11CarrierJackCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST13DownMaterialJiaZhuaCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST13DownMaterialUpDownCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    public static class ST13DownMaterialCarryCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST13SpinJiaZhua01Cy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }

    public static class ST13SpinJiaZhua02Cy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST13SpinJiaZhua03Cy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }


    public static class ST13SpinJiaZhua04Cy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }



    public static class ST16UpDownCy
    {
        public static CylinderPCToPLC_Global cylinderPCToPLC_Global = new CylinderPCToPLC_Global();

        public static CylinderPLCToPC_Global cylinderPLCToPC_Global = new CylinderPLCToPC_Global();
    }
    #endregion

    #region System
    public static class SystemPCToPLC_Global
    {

        public static bool bManualModeBT { get; set; } //手自动模式切换按钮
        public static bool bInitialBT { get; set; } //全部初始化按钮
        public static bool bHMIStart { get; set; }//触摸屏启动按钮
        public static bool bHMIStop { get; set; } //触摸屏停止按钮
        public static bool bHMIStep { get; set; } //触摸屏寸动按钮
        public static bool bHMIReset { get; set; }//触摸屏复位按钮
        public static bool bHMICycleStop { get; set; }//循环停止

        public static bool bCountClearBtn { get; set; }//计数清零按钮
        public static bool bClearMatBtn { get; set; }  //清料按钮
        public static bool bLEDPowerBtn { get; set; }  //LED灯开关
        public static bool bDryRunBtn { get; set; }    //空跑按钮
        public static bool bDoorByPass { get; set; }   //安全门屏蔽
        public static bool bPcDisableBtn { get; set; }//PC屏蔽按钮
        public static bool bCcdDisableBtn { get; set; }//CCD屏蔽按钮
        public static bool bPressByPass { get; set; }//压机屏蔽
        public static bool bWeldByPass { get; set; }//焊接屏蔽
        public static bool bTurntableByPass { get; set; }//

        public static bool[] bCarrierByPass { get; set; } = new bool[16];//载具屏蔽
        /// <summary>
        /// 初始化
        /// </summary>
        public static void Init()
        {
            bInitialBT = true;
            bManualModeBT = false;
            bHMIStart = false;
            bHMIStop = false;
            bHMIReset = false;
        }



    }


    public static class SystemPLCToPC_Global
    {
        public static bool bManualMode { get; set; }  //手自动模式
        public static bool bInitialing { get; set; }  // 初始化中
        public static bool bHMIStartLamp { get; set; }// 启动灯(HMI)
        public static bool bHMIStopLamp { get; set; } // 停止灯(HMI)
        public static bool bHMIStepLamp { get; set; } // 寸动灯(HMI)
        public static bool bHMIResetLamp { get; set; }// 复位灯(HMI)
        public static bool bHMICycleStopLamp { get; set; }// 循环停止灯(HMI)
        public static bool bClearingMat { get; set; } // 清料中
        public static bool bClearCmp { get; set; }    // 清料完成
        public static bool bDryRunning { get; set; }  // 空跑中
        public static bool bPcDisabled { get; set; }  // PC屏蔽中
        public static bool bCcdDisabled { get; set; } // CCD屏蔽中
        public static bool RecipeLoadOK { get; set; } //配方下载OK
        public static bool bool1 { get; set; } //bool 预留
        public static bool bool2 { get; set; } //预留
        public static bool bool3 { get; set; } //预留




        #region 产品计数/CT/机台状态/型号
        /// <summary>
        /// 型号
        /// </summary>
        public static int PartCode { get; set; }
        /// <summary>
        /// 产品CT
        /// </summary>
        public static float nCycleTime { get; set; }
        /// <summary>
        /// 产品总数
        /// </summary>
        public static int nCounter { get; set; }
        /// <summary>
        /// 产品成功数
        /// </summary>
        public static int nCounterOK { get; set; }
        /// <summary>
        /// 产品失败数
        /// </summary>
        public static int nCounterNG { get; set; }
        /// <summary>
        /// 产品成功率
        /// </summary>
        public static float nOKrate { get; set; }
        /// <summary>
        /// 机台状态
        /// </summary>
        public static int nMachineStatus { get; set; }



        public static bool[] nHMIDisplay_SYS { get; set; } = new bool[16];
        public static bool[] nHMIDisplay_DoorEstopAlarm { get; set; } = new bool[16];
        public static bool[] nHMIDisplay_EstopAlarm { get; set; } = new bool[16];
        public static bool[] nHMIDisplay_OtherDevice { get; set; } = new bool[16];
        public static bool[] nHMIDisplay_Connect { get; set; } = new bool[16];
        public static bool[] nHMIDispaly_NoMaterial { get; set; } = new bool[16];
        public static bool[] nHMIDispaly_Warn1 { get; set; } = new bool[16];
        public static bool[] nHMIDispaly_Warn2 { get; set; } = new bool[16];
        #endregion
    }
    #endregion

    #region 工站
    public class StationPCToPLC
    {
        public bool bInitialST { get; set; }     //初始化按钮
        public bool bDisableBT { get; set; }     //工站屏蔽按钮
        public bool bCycleStartBT { get; set; }  //单循环启动按钮
        public bool bSignSTstartBT { get; set; } //单工站启动按钮



        public bool bGT2CheckBT { get; set; }
        public bool bPressCheckBT { get; set; }
        public bool bClearCounter { get; set; }
        public bool bOtherByPass1 { get; set; }
        public bool bOtherByPass2 { get; set; }
        public bool bSpotCheckBT { get; set; }
        public bool bIn2 { get; set; }
        public bool bIn3 { get; set; }
        public bool bIn4 { get; set; }
        public bool bIn5 { get; set; }
        public bool bIn6 { get; set; }
        public bool bIn7 { get; set; }

    }
    public class StationPLCToPC
    {
        public bool bInitialSTing { get; set; } //初始化中
        public bool bDisabled { get; set; }      //工站不启用
        public bool bAlarm { get; set; }         //故障
        public bool bCycleStart { get; set; }    //单循环启动
        public bool bSignSTstart { get; set; }   //单工站启动
        public bool bCylinderAlarm { get; set; } //气缸故障
        public bool bServoAlarm { get; set; }    //伺服故障

        public bool bGT2CheckIn { get; set; }     //GT2校验中
        public bool bPressCheckIn { get; set; }   //压力校验中
        public bool bDuring { get; set; }         //抽检中
        public bool bOut2 { get; set; }           //预留
        public bool bOut3 { get; set; }           //预留
        public bool bOut4 { get; set; }           //预留
        public bool bOut5 { get; set; }           //预留
        public bool bOut6 { get; set; }           //预留
        public bool bOut7 { get; set; }           //预留
        public int nCounter { get; set; }        //总数
        public int nCounterOK { get; set; }      //OK计数
        public int nCounterNG1 { get; set; }     //NG类别1计数
        public int nCounterNG2 { get; set; }     //NG类别2计数
        public int nCounterNG3 { get; set; }     //NG类别3计数
        public float nOKrate { get; set; }         //良率
        public float nCycleTime { get; set; }      //CT
        public int nStationStatus { get; set; }  //工站状态
        public int nCarrierStatus { get; set; }  //载具状态
        public int nAlarmCount { get; set; }     //故障次数
        public int nStationNumber { get; set; }  //工站号
        public bool[] nOtherAlarmDisplay { get; set; } = new bool[16];  //工站号
        public bool[] nOtherAlarmDisplay2 { get; set; } = new bool[16];  //工站号

    }

    public static class ST0Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }

    public static class ST1Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST2Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST3Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }



    public static class ST4Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST5Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST6Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST7Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST8Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }

    public static class ST9Station_Global
    {

        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST10Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }

    public static class ST11Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }

    public static class ST12Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST13Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }



    public static class ST14Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }


    public static class ST15Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }
    public static class ST16Station_Global
    {
        public static StationPCToPLC stationPCToPLC { get; set; } = new StationPCToPLC();
        public static StationPLCToPC stationPLCToPC { get; set; } = new StationPLCToPC();
    }
    #endregion


    #region 其他


    //转盘
    public static class TurntablePCToPLC_Global
    {

        public static bool bHomeBT { get; set; }     //回原点按钮
        public static bool bJogBT { get; set; }    //点动按钮

        public static bool WeldMaualMode { get; set; }      //ST5焊机手自动切换
        public static bool WeldTextBT { get; set; }         //ST5焊机测试按钮
        public static bool WeldONBT { get; set; }           //ST5焊机开关按钮
        public static bool bIn5 { get; set; }
        public static bool bIn6 { get; set; }                //ST5焊机红光出
        public static bool bIn7 { get; set; }//ST5 焊机手动测试
        public static bool bIn8 { get; set; }
        public static bool bIn9 { get; set; }
        public static bool bIn10 { get; set; }
        public static bool bIn11 { get; set; }
        public static bool bIn12 { get; set; }
        public static bool bIn13 { get; set; }
        public static bool bIn14 { get; set; }
        public static bool bIn15 { get; set; }


        public static float nPressSetValue { get; set; }     //ST5气压设置值
        public static float nCheckValue { get; set; }        //St5压力校验值
        public static float nCheckOffset { get; set; }       //St5压力校验误差值
        public static float nParaData4 { get; set; }
        public static float nParaData5 { get; set; }


    }

    public static class TurntablePLCToPC_Global
    {
        public static bool OrgOK { get; set; }    //  原点OK
        public static bool Enable { get; set; }   //  使能
        public static bool NotAutoPos { get; set; } //不在自动位

        public static bool bIn3 { get; set; }
        public static bool bIn4 { get; set; }
        public static bool bIn5 { get; set; }
        public static bool bIn6 { get; set; }
        public static bool bIn7 { get; set; }

        public static byte StationCode { get; set; }  //位置代码

        public static short EncodeAngle { get; set; } //编码角度

        public static float ST5WeldPress { get; set; }  //ST5焊接压力实时值
        public static float nParaData3 { get; set; }//转盘自动位置
        public static float nParaData4 { get; set; }
        public static float nParaData5 { get; set; }

    }



    public static class CCDPCToPLC_Global
    {

        public static bool ST3bAutoTrigger { get; set; }     //ST3CCD拍照触发
        public static bool ST3DisableBT { get; set; }     //ST3CCD屏蔽按钮
        public static bool ST3LightBT { get; set; }     //ST3CCD光源打开按钮
        public static bool ST3BIn3 { get; set; }     //预留
        public static bool ST3bIn4 { get; set; }     //预留
        public static bool ST3bIn5 { get; set; }     //预留
        public static bool ST3bIn6 { get; set; }     //预留
        public static bool ST3bIn7 { get; set; }     //预留
        public static bool ST11ManualTrigger { get; set; }  //ST11手动拍照按钮
        public static bool ST11DisableBT { get; set; }      //ST11CCD屏蔽按钮
        public static bool ST11LightBT { get; set; }        //ST11CCD光源打开按钮
        public static bool ST5bIn8 { get; set; }     //ST5CCD校验按钮
        public static bool ST5bIn9 { get; set; }     //ST5模式切换
        public static bool ST5bIn10 { get; set; }     //预留
        public static bool ST5bIn11 { get; set; }     //预留
        public static bool ST5bIn12 { get; set; }     //预留

        public static short ST3Mode { get; set; }     //ST3CCD模式选择
        public static short nParaData1 { get; set; }     //预留
        public static float nParaData2 { get; set; }     //预留
        public static float nParaData3 { get; set; }        //预留
    }


    public static class CCDPLCToPC_Global
    {

        public static bool ST3ResultOK { get; set; }     //ST3CCD拍照结果OK
        public static bool ST3ResultNG { get; set; }     //ST3CCD拍照结果NG
        public static bool bIn2 { get; set; }             //预留
        public static bool bIn3 { get; set; }             //预留
        public static bool bIn4 { get; set; }             //预留
        public static bool bIn5 { get; set; }             //预留
        public static bool bIn6 { get; set; }             //预留
        public static bool bIn7 { get; set; }             //预留

        public static bool ST11ResultOK { get; set; }     //ST11CCD拍照结果OK
        public static bool ST11ResultNG { get; set; }     //ST11CCD拍照结果NG
        public static bool bIn10 { get; set; }             //预留
        public static bool bIn11 { get; set; }             //预留
        public static bool bIn12 { get; set; }             //预留
        public static bool bIn13 { get; set; }             //预留
        public static bool bIn14 { get; set; }             //预留
        public static bool bIn15 { get; set; }             //预留

        public static float nParaData0 { get; set; }       //预留
        public static float nParaData1 { get; set; }       //预留
        public static float nParaData2 { get; set; }       //预留
        public static float nParaData3 { get; set; }       //预留


    }
    #endregion


    #region ProductData


    public static class ProductData_Global
    {
        public static int CarrierID { get; set; }          //载具号

        public static float PinWidth { get; set; }        //ST3针间距
        public static float ST3PartOKW { get; set; }      //St3产品状态
        public static float Press { get; set; }           //ST5压力
        public static float ST5PartOKW { get; set; }      //St5产品状态
        public static float WeldArea { get; set; }        //焊缝面积
        public static float St11PartOKW { get; set; }     //St11产品结果
        public static float ProductResult { get; set; }   //ST7产品总结果

    }



    #endregion


    #region CPK 

    public class CPK
    {
        public float Compare_Data { get; set; }
        public float Max_Data { get; set; }
        public float MIn_Data { get; set; }
        public float Average_Data { get; set; }
        public float σ_Data { get; set; }
        public float Cp { get; set; }
        public float Cpk { get; set; }

    }

    public static class ST1CPK_Global
    {
        public static CPK CPK1 { get; set; }
    }

    public static class ST2CPK_Global
    {
        public static CPK CPK2 { get; set; }
    }

    public static class ST3CPK_Global
    {
        public static CPK CPK3 { get; set; }
    }

    public static class ST4CPK_Global
    {
        public static CPK CPK4 { get; set; }
    }

    public static class ST5CPK_Global
    {
        public static CPK CPK5 { get; set; }
    }

    public static class ST6CPK_Global
    {
        public static CPK CPK6 { get; set; }
    }
    #endregion


    #region IO

    public static class IO_Global
    {
        public static bool[] IO_R = new bool[320];
    }



    #endregion



    #region 报警


    public static class Alarm_Global
    {
        public static bool[] Alarms = new bool[1120];
    }
    #endregion


    public static class LoginInfo
    {
        public static bool IsLogin { get; set; } = true;
    }
}
